<template>
  <div>
    <MyHeader :title="title" color="#d6e568" bgc="deeppink"></MyHeader>
    <div class="main">
      <MyGoods v-for="item in list" :key="item.id" :list="item"></MyGoods>
    </div>
    <MyFooter :list='list'></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader";
import MyGoods from "./components/MyGoods";
import MyFooter from "./components/MyFooter";
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },
  data() {
    return {
      list: [],
      title: "购物车liebiao",
    };
  },
  created() {
    this.$axios({
      url: "/api/cart",
      method: "GET",
    })
      .then((res) => {
        this.list = res.data.list;
      })
      .catch((err) => {
        console.log(err);
      });
  },
};
</script>

<style>
.main {
  padding-top: 45px;
  padding-bottom: 50px;
}
</style>